package main

import (
	"fmt"
	"runtime"
	"time"
)

func main(){
	go func() {
		for {
			fmt.Println("i'm child goroutine")
			time.Sleep(time.Microsecond)
		}
	}()

	for{
		runtime.Gosched()  //让出cpu时间片(并不是挂起,后面还会执行),重新执行后从让出的位置开始执行
		fmt.Println("i'm main goroutine")
	}
}